public class ViterbiProbs 
{
    
    
  

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((pos1 == null) ? 0 : pos1.hashCode());
	result = prime * result + ((pos2 == null) ? 0 : pos2.hashCode());
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	ViterbiProbs other = (ViterbiProbs) obj;
	if (pos1 == null) {
	    if (other.pos1 != null)
		return false;
	} else if (!pos1.equals(other.pos1))
	    return false;
	if (pos2 == null) {
	    if (other.pos2 != null)
		return false;
	} else if (!pos2.equals(other.pos2))
	    return false;
	return true;
    }

    private String pos1;
    private String pos2;
    private double prb;
    private String bestPreviousTag;
    
    private ViterbiProbs(String pos1, String pos2, double prb, 
	    String bestPreviousTag)
    {
	this.pos1= pos1;
	this.pos2= pos2;
	this.prb= prb;
	this.bestPreviousTag= bestPreviousTag;
	
    }
    
    public static ViterbiProbs newViterbiProb(String pos1, String pos2, double prb, 
	    String bestPreviousTag)
    {
	ViterbiProbs newViterbiProb = new ViterbiProbs(pos1, pos2, prb, bestPreviousTag);
	return newViterbiProb;
    }
    
    public String getBestPreviousTag()
    {
	return this.bestPreviousTag;
    }
    
    public double getProb()
    {
	return this.prb;
    }
    
    public String getPOS1()
    {
	return this.pos1;
    }
    
    public String getPOS2()
    {
	return this.pos2;
    }
    
    public String toString()
    {
//	String output = "Pos1 is: " + pos1 + " Pos2 is: " + pos2
//	+ " Probability is: " + prb + " Best previous tag is: " + bestPreviousTag;
	
	String output = "{Pos1 is: " + pos1 + " Pos2 is: " + pos2 + "|" + getBestPreviousTag()  
	+ " prb " +  getProb()+  "}" ;
	return output;
    }
    
}
